package com.taotaojs.util.excel;

import lombok.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: TaoTaojs
 * @Date: 2019/4/3 9:41
 * @Description:
 * 普通列表头类
 * @关联类:
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@EqualsAndHashCode(callSuper = false)
public class ExcelHead extends AbstractExcelHead {

    /**Excel列名*/
    private String excelName;
    /**Excel实际列名*/
    private String excelNameEnabl;
    /**实体类属性名*/
    private String entityName;
    /**值必填*/
    @Builder.Default
    private boolean required = false;
    /**是否是数据列*/
    private boolean isData;
    /**是否强制使用字符串类型换取值?没啥意义，在编辑Excel的时候，数据已经定下来了，只能把Excel全盘设置为文本类型*/
    private boolean isString;
    /**默认标识*/
    private boolean def;

    public static List<ExcelHead> getExcelHeads(String[] excels, String[] entitys){
        List<ExcelHead> list=new ArrayList<>();
        for(int i=0;i<excels.length;i++){
            ExcelHead excelHead = new ExcelHead();
            excelHead.setExcelName(excels[i]);
            excelHead.setEntityName(entitys[i]);
            list.add(excelHead);
        }
        return list;

    }

}
